package cn.lovemmd.model.admin.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 模型视图对象
 * 
 * @author TLS
 * @since 2024-01-01
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ModelVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 模型ID
     */
    private Long MId;

    /**
     * 模型名称
     */
    private String MName;

    /**
     * 模型职业
     */
    private String MOccupation;

    /**
     * 模型职业中文名称
     */
    private String MOccupationName;

    /**
     * 模型下载链接
     */
    private String MUrl;

    /**
     * 模型图片链接
     */
    private String MImg;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 获取职业中文名称
     */
    public String getMOccupationName() {
        if (MOccupation == null) {
            return "";
        }
        switch (MOccupation) {
            case "bladePoint":
                return "刀锋";
            case "Flame":
                return "烈焰";
            case "doubleGun":
                return "双枪";
            case "machineGun":
                return "机枪";
            case "guidedMissile":
                return "导弹";
            case "sniper":
                return "狙击";
            case "medic":
                return "医生";
            case "grenade":
                return "榴弹";
            case "engineer":
                return "工程师";
            default:
                return MOccupation;
        }
    }
}
